/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package boundaries;

import utils.ImageLoader;
import controllers.InvitationManager;
import entities.Event;
import entities.OutdoorEvent;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author Alberto, Alessandra
 */
@ManagedBean
@ViewScoped
public class EventDetailsBean {
    
    private Event event;

    public Event getEvent() {
        return event;
    }

    public void setEvent(Event event) {
        this.event = event;
    }
    
    public EventDetailsBean () {
        this.event = (Event) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("selectedevent");
    }
    
    public String getType () {
        if (event instanceof OutdoorEvent)
            return "Outdoor";
        else return "Indoor";
    }
    
    public String getWeatherForecast () {
        if (event instanceof OutdoorEvent && ((OutdoorEvent)event).isForecasted()) {
            return ImageLoader.getWeatherImgBig(((OutdoorEvent)event).getWeatherforecast().getName());
        } else {
            return "";
        }
    }
    
}
